Skip to content

Fix visual mode e behaving like w#53

Merged
oribarilan merged 1 commit into
mainfrom
fix/visual-e-motion
Jul 1, 2026
Merged

Fix visual mode e behaving like w#53
oribarilan merged 1 commit into
mainfrom
fix/visual-e-motion

Conversation

@oribarilan

Copy link
Copy Markdown
Owner

Visual mode e was mapped to input.select.word.forward (the same host command as w), so both moved to the start of the next word instead of the end of the current one.

This adds a dedicated e handler in handleVisualKey that reuses the existing endOfWord() helper and extends the selection from the visual anchor to the computed offset. Also introduces visualAnchor on VimState, tracked on v/V entry, so custom motions in visual mode know where the selection started.

Closes #52

Previously e in visual mode was mapped to the same host command as w
(input.select.word.forward), making them behave identically. This adds
a dedicated handler that reuses the existing endOfWord() computation
and emits a selectRange from the visual anchor to the correct offset.

Closes #52
@oribarilan oribarilan merged commit 425c9c8 into main Jul 1, 2026
1 check passed
@oribarilan oribarilan deleted the fix/visual-e-motion branch July 1, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e key has different behavior in normal vs visual modes

1 participant